package April.eight;

import java.util.Calendar;
/*
练习Calendar类中的add方法
 表示将所选日期偏移
 */
public class CalendarDemo2 {
    public static void main(String[] args){
        function();
    }

    public static void function(){
        Calendar time = Calendar.getInstance();
        int h = time.get(Calendar.YEAR);
        System.out.println(h);
//      将时间年增加100
        time.add(Calendar.YEAR,100);
        int j = time.get(Calendar.YEAR);
        System.out.println(j);
    }
}
